﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


class FreeTime
{
    // TODO
    public FreeTime()
        : this(new[] { Tuple.Create(8.00, 23.00) }) {
    }
    public FreeTime(IEnumerable<Tuple<double, double>> Intervals) {
        this.Intervals = Intervals;
    }
    // hack
    double time = 8.00;

    public IEnumerable<Tuple<double, double>> Intervals { get; private set; }

    public double GetStartTime() {
        return time;
//         throw new NotImplementedException();
    }

    public void RemoveRange(double start, double end) {
        time = end;
       // throw new NotImplementedException();
    }

    /* Boilerplate */

    public override string ToString() {

        string ret = string.Empty;

        ret += "Intervals = " + this.Intervals;

        ret = "{FreeTime: " + ret + "}";
        return ret;

    }


    public object this[string field] {
        get {
            if (field == "Intervals") return Intervals;
            throw new ArgumentException();
        }
        set {
            if (field == "Intervals") { Intervals = (IEnumerable<Tuple<double, double>>)value; return; }
            throw new ArgumentException();
        }
    }

}
